# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=maltego
pkgver=4.11.0
_pkgname=Maltego
pkgrel=1
groups=('blackarch' 'blackarch-forensic' 'blackarch-recon' 'blackarch-scanner')
pkgdesc='An open source intelligence and forensics application, enabling to easily gather information about DNS, domains, IP addresses, websites, persons, etc.'
arch=('any')
url='https://www.maltego.com/downloads/'
license=('GPL')
depends=('java-environment=11' 'giflib')
source=("https://downloads.maltego.com/maltego-v4/linux/Maltego.v$pkgver.linux.zip")
sha512sums=('253de3617c826210079b924358c71fd8cc12bbda9c268e6591f3795c7089317b6cbe253fd6c7acfa0bad60a978ecc4acb0eefb0edc0d44655afb58e9d60b82b6')

package() {
  cd "${pkgname}_${pkgver}"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -aR * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/bin
exec ./$pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

